/**
 * 特快速輸管理，共同上層
 */
function CommonSpecialQuickInput() {
    this.languageErrorNo = "BetForm.Message.ErrorNo";
    this.languageStringFormatError = "BetForm.Message.StringFormatError";
}

/**<!--  只能輸入數字 . = 空白  -->*/
CommonSpecialQuickInput.prototype.filterString = function(id) {
    $("#" + id).val($("#" + id).val().replace(/[^0-9=.\s]/g, ''));
};

/**
 * 取得注單列表
 * @param tempString 暫存字串
 */
CommonSpecialQuickInput.prototype.getBets = function(tempString) {
    var str = tempString;
    //<!--  01=100 18=300 29=800 30=900 ==>01100.18300.29800.30900  -->
    str = str.replace(/=/g, '');
    str = str.replace(/\s/g, '.');
    return str.split('.');
};
/**
 * 過濾字串頭尾的空白
 * @param tempString
 */
CommonSpecialQuickInput.prototype.filterHeadTailSpace = function(tempString) {
    var newValue = tempString;
    newValue = newValue.replace(/^\s/, '');
    newValue = newValue.replace(/\s$/, '');
    return newValue;
};
/**<!--  檢查總注金限制  -->*/
CommonSpecialQuickInput.prototype.checkBetTotalCredit = function(totalCredit) {
    /**<!--  可用信用額度不足  -->*/
    if (eval(totalCredit) > ($('#txtBalanceQuota').val())) {
        throw "canUseCreditNotEnought";
    }
};
/**<!--  檢查單一注金限制  -->*/
CommonSpecialQuickInput.prototype.checkBetCredit = function(betCredit) {
    /**<!--  不能小於單注最低限額  -->*/
    if (eval(betCredit) < $('#varMinBetQuota').val()) {
        throw "cantSmallerThanMinQuota";
    }
    /**<!--  不能大於單注最高限額  -->*/
    if (eval(betCredit) > $('#varMaxBetQuota').val()) {
        throw "cantGreaterThanMaxQuota";
    }
    /**<!--  不能大於單號限額  -->*/
    if (eval(betCredit) > $('#varQuota').val()) {
        throw "cantGreaterThanQuota";
    }
    /**<!--  可用信用額度不足  -->*/
    if (eval(betCredit) > ($('#txtBalanceQuota').val())) {
        throw "canUseCreditNotEnought";
    }
};
/**
 * 傳送到下注頁
 */
CommonSpecialQuickInput.prototype.sendBetPage = function() {
    var form = document.getElementById('GAMEFORM');
	form.submit();
};
